package com.xuhuan.demo.pattern.prototype.deepclone;

/**
 * @author huan.xu
 * @date 2021/10/5 15:51
 * @description
 */
public class Client {

    public static void main(String[] args) throws CloneNotSupportedException {
        DeepPrototype deepPrototype = new DeepPrototype("name1",
                new DeepCloneableTarget("cloneName", "cloneClass"));
//        DeepPrototype clone = (DeepPrototype) deepPrototype.clone();
        DeepPrototype clone = (DeepPrototype) deepPrototype.deepClone();
        System.out.println("deepPrototype:" + deepPrototype.getName() + "," + deepPrototype.getDeepCloneableTarget().hashCode());
        System.out.println("clone:" + clone.getName() + "," + clone.getDeepCloneableTarget().hashCode());
    }
}
